extern void ide_probe_devices(xen_disk_info_t *);
extern void scsi_probe_devices(xen_disk_info_t *);
+ extern void cciss_probe_devices(xen_disk_info_t *);
xen_disk_info_t xdi;
xen_disk_t *xd;
xdi.disks = xd;
ide_probe_devices(&xdi);
scsi_probe_devices(&xdi);
+ cciss_probe_devices(&xdi);
for ( i = 0; i < xdi.count; i++ )
{
xen_extent_t e;
}
hba[ctlr]->gendisk.nr_real = hba[ctlr]->highest_lun+1;
}
+
+
+void cciss_probe_devices(xen_disk_info_t *xdi)
+{
+ int i, ctlr;
+ drive_info_struct *drv;
+ xen_disk_t *xd = &xdi->disks[xdi->count];
+
+ ctlr = 0; /* XXX SMH: only deal with 1 controller for now */
+
+ /* Loop through each real device */
+ for(i=0; i < NWD; i++) {
+
+ drv = &(hba[ctlr]->drv[i]);
+
+ if (!(drv->nr_blocks))
+ continue;
+
+ if ( xdi->count == xdi->max )
+ BUG();
+
+
+ hba[ctlr]->hd[i << NWD_SHIFT].nr_sects =
+ hba[ctlr]->sizes[i << NWD_SHIFT] = drv->nr_blocks;
+
+ /* We export 'raw' linux device numbers to domain 0. */
+ xd->device = MKDEV(hba[ctlr]->major, i << 4);
+ xd->info = XD_TYPE_DISK; /* XXX should check properly */
+ xd->capacity = drv->nr_blocks; /* in terms of 512byte sectors */
+ xd->domain = 0;
+
+ xdi->count++;
+ xd++;
+
+ }
+
+}
+
/*
* Open. Make sure the device is really there.
*/
seg = 0;
lastdataend = ~0ULL;
while(bh) {
-// if (bh_phys(bh) == lastdataend)
- if ((page_to_phys(bh->b_page) + bh_offset(bh))== lastdataend)
+
+ if (bh_phys(bh) == lastdataend)
{ /* tack it on to the last segment */
tmp_sg[seg-1].length +=bh->b_size;
lastdataend += bh->b_size;
bh->b_size = phys_seg[i].nr_sects << 9;
bh->b_dev = phys_seg[i].dev;
bh->b_rsector = (unsigned long)phys_seg[i].sector_number;
+
+ /* SMH: we store a 'pseudo-virtual' bogus address in b_data since
+ later code will undo this transformation (i.e. +-PAGE_OFFSET). */
bh->b_data = phys_to_virt(phys_seg[i].buffer);
+
+ /* SMH: bh_phys() uses the below field as a 'cheap' virt_to_phys */
+ bh->b_page = &frame_table[phys_seg[i].buffer>>PAGE_SHIFT];
bh->b_end_io = end_block_io_op;
bh->pending_req = pending_req;